import request  from '@/request';
import type {addFormData , editFormData} from "../@types";

/**新增菜单*/
export const addMenu = (data : addFormData) => request({
    url: '/api/v2/admin/addAdminNewMenu',
    method: 'post',
    data
}) 

/**查询父级菜单*/
export const getParentMenu = () => request({
    url: '/api/v2/admin/getParentMenu',
    method: 'get'
}) 

/**
 * 获取菜单列表
 * */ 
export const getMenuList = (params : { name ?: string , title ?: string} ) => request({
    url: '/api/v2/admin/getMenu',
    method: 'get',
    params
})


/**
 * 更新菜单
 * */ 
export const updateMenu = (data : editFormData) => request({
    url: '/api/v2/admin/updateAdminNewMenu',
    method: 'post',
    data
})

/**
 * 删除菜单
 * */ 
export const deleteMenu = (data : { ID : string }) => request({
    url: '/api/v2/admin/deleteAdminNewMenu',
    method: 'post',
    data
})
